Skip to main content

CreateSnatEntry

Description

Call the CreateSnatEntry interface to add SNAT entries to the SNAT list.

Request Method

POST

Request Path

/apsara/route/Vpc/CreateSnatEntry

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
SourceVSwitchIdBODYstringNovsw-bp1nhx2s9ui5o****ID of switch requiring public network access.
SnatEntryNameBODYstringNoSnatEntry-1The name of the SNAT entry. 2 to 128 characters in length, which must start with a letter or Chinese, but cannot start with http:// or https://.
SourceCIDRBODYstringNo10.1.1.0/24The CIDR block of the switch or ECS instance. Switch granularity: Specify the network segment of the switch (for example, 192.168.1.0/24). When the ECS instance under the switch initiates an Internet access request, the NAT gateway will provide SNAT service (proxy Internet service) for it. If SnatIp only specifies one public network IP, the ECS instance uses the specified public network IP to access the Internet; if SnatIp specifies multiple public IP addresses, the ECS instance randomly uses the public IP address in SnatIp to access the Internet. ECS granularity: Specify the address of the ECS instance (for example, 192.168.1.0/32). When the ECS instance initiates an Internet access request, the NAT gateway will provide SNAT service (proxy Internet service) for it. If SnatIp only specifies one public network IP, the ECS instance uses the specified public network IP to access the Internet; if SnatIp specifies multiple public IP addresses, the ECS instance randomly uses the public IP address in SnatIp to access the Internet. this parameter and SourceVSwtichId parameters are mutually exclusive, can't be at the same time. If SourceVSwitchId is specified, the SourceCIDR parameter cannot be specified. If SourceCIDR parameter is specified, the SourceVSwitchId parameter cannot be specified.
regionIdBODYstringYesNo sample value for this parameter.region id
RegionIdBODYstringYescn-qingdao-env17-d01the region ID of the NAT gateway. you can obtain the region by calling DescribeRegions interface ID.
SnatIpBODYstringYes47.XX.XX.98public network IP address, separated by commas.
ClientTokenBODYstringNo02fb3da4-130e-11e9-8e44-001****Ensure request idempotence. Generate a parameter value from your client to ensure that the parameter value is unique between different requests. ClientToken only supports ASCII characters and cannot exceed 64 characters.
versionBODYstringNo2016-01-01version of api
SnatTableIdBODYstringYesstb-bp190wu8io1vgev****SNAT table ID.

Return data

NameTypeSample valueDescription
RequestIDstring1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DCRequest id

Example

Successful Response example

{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}